<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <input type="text" name="" id="num">
    <button id="btn">判断</button>
    <input type="text" id="num1">
    <input type="text" name="" id="num2">
    <button id="btn2">判断</button>
    <input type="text" id="num3">
    <script>
        document.getElementById("btn").onclick = function() {
            var _num = Number(document.getElementById("num").value);
            if (_num % 2 === 0) {
                document.getElementById("num1").value = "偶数";
            } else {
                document.getElementById("num1").value = "齐数";
            }
        }
        document.getElementById("btn2").onclick = function() {
            var _num2 = Number(document.getElementById("num2").value);
            var a = (_num2 % 2 === 0) === true ? "偶数" :
                "奇数";

            document.getElementById("num3").value = a;
        }
    </script>
</body>

</html>